<template>
<div>
  <el-table
    :data="goodsList"
    style="width: 100%">
    <el-table-column type="expand">
      <template slot-scope="props">
        <el-form label-position="left" inline class="demo-table-expand">
          <el-row>
            <el-col :span="2" v-for='g in props.row.goods_set' :key="g.id">
              <el-form-item  >
                <span>{{ g.name }}</span>
              </el-form-item>Î
            </el-col>
          </el-row>
        </el-form>
      </template>
    </el-table-column>

    <el-table-column
      label="分类名称"
      prop="name">
    </el-table-column>

  </el-table>

</div>
</template>

<script>
export default {
  name: "goodlist",
  data(){
    return{
      cateList: [],
      goodsList:[],
    }
  },
  methods:{
    getCateList(){
      //发起axios请求
      this.$axios.get('cate/')
        .then(resp=>{
        console.log(resp.data)
        this.goodsList = resp.data
        // if(res.data.code == 200){
        //     this.catelist = res.data.catelist
        // }

      })
    }



  },
  created() {
    this.getCateList();

  }
}
</script>

<style scoped>
.demo-table-expand {
  font-size: 0;
}
.demo-table-expand label {
  width: 90px;
  color: #99a9bf;
}
.demo-table-expand .el-form-item {
  margin-right: 0;
  margin-bottom: 0;
  width: 50%;
}
</style>
